<?php
	class Province_Model extends CI_Model {
		function __construct()
		{
			parent::__construct();	
		}
		
		function lists($geo_id=0,$page=1000,$limit=5000)
                {
			$this->db->order_by("PROVINCE_NAME", "ASC");
			
			if(!is_array($geo_id) AND $geo_id!=0){
				$this->db->where("GEO_ID", $geo_id);
			}elseif(is_array($geo_id)){
				$this->db->where_in("GEO_ID", $geo_id);
			}
			
			$this->db->from('province');
			$query = $this->db->get();
			return $query->result();
                }
		
		function getProvinceNameByCatId($id)
		{
			$query = $this->getProvinceInfoByCatId($id);
			return $query['PROVINCE_NAME'];
		}
		
		function getProvinceInfoByCatId($id)
		{
			$query = $this->db->get_where('province', array('PROVINCE_ID' => $id));
			return $query->row_array();
		}
		
		function geography_lists($page=1,$limit=5000)
                {
			$this->db->order_by("GEO_NAME", "ASC");
			$this->db->from('geography');
			$query = $this->db->get();
			return $query->result();
                }
		
		function get_geo_id($id)
                {
			$query = $this->getProvinceInfoByCatId($id);
			return $query['GEO_ID'];
                }
	}


/* End of file province_model.php */
/* Location: ./application/models/admin/province_model.php */